#include <iostream>
using namespace std;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 205;

int n, m;
int a[N], b[N];
void mul(int a[N], int b[N], int c[N]) {
  int tmp[N] = {0};
  rep(i, 0, m) rep(j, 0, m) tmp[i + j] += a[i] * b[j];
  rep(i, 0, m) c[i] = tmp[i];
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  while (cin >> n >> m) {
    rep(i, 0, m) a[i] = 0;
    a[0] = 1;
    rep(i, 1, n) {
      int l, r;
      cin >> l >> r;
      if (l > r) swap(l, r);
      rep(j, 0, m) b[j] = 0;
      rep(j, l, r) b[j] = 1;
      mul(a, b, a);
    }
    cout << a[m] << endl;
  }
  return 0;
}